import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type homeResult = {
  page: any;
  result: any
};

/** 查询产品详细信息 */
export const getproductselproductinfo = (id) => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/product/selproductinfo/${id}`));
};


/** 新增产品基础信息 */
export const productinserpro = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/product/inserpro"), { data });
};

/** 产品列表分页查询 */
export const productselpage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/product/selpage"), { data });
};

/** 修改产品基础信息 */
export const productgrclass = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/product/grclass"), { data });
};

/** 删除产品分类信息 */
export const productdelinfo = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/api/backend/product/delinfo/${userid}`));
};